UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QORsoIMtTIthWUZhJXWWVebE/XBz7WdEX7Ik2v1IgBY=' 
WHERE 
  key_id = '13df232bd3599a852b8ec9f3728d30884f976f32f60fbe2ecca4c0d88f6e3258' 
  AND (
    token = 'QORsoIMtTIthWUZhJXWWVebE/XBz7WdEX7Ik2v1IgBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035