UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Sd/5t3W2i7KGykwTYKUdKYnCcg0e9xYgHY5ee2MW0I=' 
WHERE 
  key_id = '3431a1e5b17d97cd301eac9aa9fd3ef2d6987c4c4163931ef0ae184d1fe4ce49' 
  AND (
    token = '7Sd/5t3W2i7KGykwTYKUdKYnCcg0e9xYgHY5ee2MW0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031