UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bTiTGJWKplWl3QGSxwfmf+yQcD3LTkwsgOoxvMrkaIo='
WHERE
key_id = 'dad105e9f051c349bde7bbb8abb18dff83fca52a2439f4d4951649b7748c4159'
AND (
token = 'bTiTGJWKplWl3QGSxwfmf+yQcD3LTkwsgOoxvMrkaIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)