UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrmS2iwODukxiWrzCJJ4wLgUu9bqnTPWuyJ+q/VLwqw=' 
WHERE 
  key_id = '02529f2fa9f891af0b5d00efbdb82e422f33e8fee1723e951b8f2266cdc3f40b' 
  AND (
    token = 'xrmS2iwODukxiWrzCJJ4wLgUu9bqnTPWuyJ+q/VLwqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062