UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ek+3Z+sr+kpy8iQDPXZ1wobRGIzRhFNGUErQXpjbuPs='
WHERE
key_id = '783dc0de319ddce4dc1378f54d3c4c151e54b296b56b6755404b8db9002ce231'
AND (
token = 'Ek+3Z+sr+kpy8iQDPXZ1wobRGIzRhFNGUErQXpjbuPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)