UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vP4S5b3BLYa3ulRSSPgsI/vQJ+9hfiYtMVz5ej2xQoI='
WHERE
key_id = '23c8b59303e0df10f8103566ddd7fb26f4f534337ccdab1d572b8f48f845a04e'
AND (
token = 'vP4S5b3BLYa3ulRSSPgsI/vQJ+9hfiYtMVz5ej2xQoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)