UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E6vIL3rIX5VO+q8SK79mJdXmsGAAJyeGfrJuFEp9qXI='
WHERE
key_id = 'd85625ecd53a6d676835559080dc53bbf24982af5aa25cd489264c9976229047'
AND (
token = 'E6vIL3rIX5VO+q8SK79mJdXmsGAAJyeGfrJuFEp9qXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)