UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TXkvmelu3I0BqPQjD63DWtTnxiI7kkAhMoSdX0BGj/w='
WHERE
key_id = '9d093d8779b723742307dfc4bf93b6f3b184eb81b47073f68ab2834c6f93657c'
AND (
token = 'TXkvmelu3I0BqPQjD63DWtTnxiI7kkAhMoSdX0BGj/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)