UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2J+6n/lV0RmUzdjO7P29403YaBLYFWHYZ3vw84TWpps='
WHERE
key_id = '1557414f2a6c780d25ac5284ea40df9f6ed2d3054fcccaa9a3a3f83616482a8e'
AND (
token = '2J+6n/lV0RmUzdjO7P29403YaBLYFWHYZ3vw84TWpps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)