UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQnvHmoYY/pPEWw6ouwjpYMq5eGB4b1uYSYlGNDt7pw='
WHERE
key_id = '4cd5f2d1cfc40f05fcc3127b6ad5e58a1b6b74ab6196230bc8d7a77f5ebdb0e8'
AND (
token = 'PQnvHmoYY/pPEWw6ouwjpYMq5eGB4b1uYSYlGNDt7pw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)