UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qYB++8BRYzPmbpROipQHDq/0SbsiPEdO9QcSUkrxFG0='
WHERE
key_id = '28d37b45124c2cdef9e9ea1846caa3f6c2af67ea16b032ad3717bda0e18a6982'
AND (
token = 'qYB++8BRYzPmbpROipQHDq/0SbsiPEdO9QcSUkrxFG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)