UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4DArHDCly1ZkTOUnITRaQ12nuQWFyffKX13JNHZZwrg='
WHERE
key_id = '3d8e2588ff0f4e4d96582ed2ee32ded9a9ec85010ae5621239d3bc9ddcb5eb83'
AND (
token = '4DArHDCly1ZkTOUnITRaQ12nuQWFyffKX13JNHZZwrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)