UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h0e9JsX2FHe/HoXIgWQrQb0VaTLejKjfaiMBU7Yg70A='
WHERE
key_id = '0f63990a63d8862cbd6c1889aedd3b59b21a65cef1bcc9f6ab88eee8a4dffb4d'
AND (
token = 'h0e9JsX2FHe/HoXIgWQrQb0VaTLejKjfaiMBU7Yg70A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)