UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DYQG1E/aikGgT0Do3Irlq6EpEtRXXf4uNXCFha8OVxo='
WHERE
key_id = 'b137cee9845590d9ed95ea8bb3476666e277d30ab3a7ec6cdf48ff5afca50f82'
AND (
token = 'DYQG1E/aikGgT0Do3Irlq6EpEtRXXf4uNXCFha8OVxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)