UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '50X6b1B5kpZeOMiSdcieISWjH3J3zVyrWSdnnQbfZ2c='
WHERE
key_id = '7200588f574c342f1b8fd9cb3a4ac4377d9116ac2bef237be2dd8d81ab40a947'
AND (
token = '50X6b1B5kpZeOMiSdcieISWjH3J3zVyrWSdnnQbfZ2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)