UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TVjCror17WZa/VuYFRl9l38Hsb9NdOD80BssuUWc48I='
WHERE
key_id = '8c2307ce20e8ecc22ef57e8c67e7e8df926136f5d9e7a1e28b4ddd1a735b91bc'
AND (
token = 'TVjCror17WZa/VuYFRl9l38Hsb9NdOD80BssuUWc48I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)