UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZkPXc9C5HlXnHqVJsGbKYRoAm0/sffYMSPddH1KC5oE='
WHERE
key_id = '28f3a69f6d5e2215214af2b1cc4883f92d15ad72d26b4807b78f39e0d56283dd'
AND (
token = 'ZkPXc9C5HlXnHqVJsGbKYRoAm0/sffYMSPddH1KC5oE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)