UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gzKGfuQP54CqESX7SWtaZPVpP6U11VIDSwGXpsTF/U8='
WHERE
key_id = 'e1d33808c271b8c4d98cff901c87d10e7e2a00bce7ddeadc8e76ac3233ec28bf'
AND (
token = 'gzKGfuQP54CqESX7SWtaZPVpP6U11VIDSwGXpsTF/U8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)