UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HffEOh3A8rdc/WfepDvrQ7V5ROQXLAVYhZlP+Njr9M='
WHERE
key_id = 'e036c6fb1a9893e395bf3d9c494ef878d4a64bde6d76497d8de6ad3483cde949'
AND (
token = '5HffEOh3A8rdc/WfepDvrQ7V5ROQXLAVYhZlP+Njr9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)