UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's8H72jQITXTniHZyZovrt4R1c2t7vGhqPZ9R7jXFq1s='
WHERE
key_id = '5dbead98f46abde0478543b241cca044810dee6682c2d2fdae0b0ed8dc601080'
AND (
token = 's8H72jQITXTniHZyZovrt4R1c2t7vGhqPZ9R7jXFq1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)