UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oid15wrHnboqvMvrx0P3aZP4znDdMLeJ9JpM9jWVU/E='
WHERE
key_id = 'c6df88646391ff6d57c3688e644a70183ebdc78ee08fada1b2f7ac27d4730f7e'
AND (
token = 'oid15wrHnboqvMvrx0P3aZP4znDdMLeJ9JpM9jWVU/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)