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