UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XrDAFa8ImDDUrLz7eArqg/t9AsZUJxQtlTCHe1jJzxs=' 
WHERE 
  key_id = '1154d34400a7632c75bf71a90ac41bf28181d1630d1b0eb4d85f7f958e6b7864' 
  AND (
    token = 'XrDAFa8ImDDUrLz7eArqg/t9AsZUJxQtlTCHe1jJzxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023