UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WwnWlbZSXKsi6C+tZa83JRQEN9wRmlrkA4sQRrgF+nE='
WHERE
key_id = '7c49f3a1d0c3b07828604847ed4915717189515005ff6a609a266661d2e7b215'
AND (
token = 'WwnWlbZSXKsi6C+tZa83JRQEN9wRmlrkA4sQRrgF+nE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)