UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rwk3ajmleFoOYWzTVyuSVEUqt8dk0KPs7V3666vh0eQ='
WHERE
key_id = 'a90ef5a31de931bf413a1d4624a37e0a01e8e49fb75b2a0b04bc92d5085bbf64'
AND (
token = 'Rwk3ajmleFoOYWzTVyuSVEUqt8dk0KPs7V3666vh0eQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)