UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnYFmiAJ49ggT2CGKNp/dBErBsFJ/L8vVaxGMORjgYw=' 
WHERE 
  key_id = '12e0c6e954de55459bcc9f4bb0fe638bce12c4847527f5859d5cfbee90cf3253' 
  AND (
    token = 'vnYFmiAJ49ggT2CGKNp/dBErBsFJ/L8vVaxGMORjgYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038