UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rejdga0udX2QPqp0zI/uqIGcCX5nhGijI1+vA2O9CQ='
WHERE
key_id = '668c0dd92713f56aaf4e2aace5b5a445e71a82d7914d93da186568bdcea32863'
AND (
token = '3rejdga0udX2QPqp0zI/uqIGcCX5nhGijI1+vA2O9CQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)