UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I80TjzAz2D61jCaRLebiPjKh8OdASMqH5oZN/Lpm2TU='
WHERE
key_id = '4b69c1fd6292fa49f70b1187405a2d015008d89951a71bf9c65a5bb79af10507'
AND (
token = 'I80TjzAz2D61jCaRLebiPjKh8OdASMqH5oZN/Lpm2TU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)