UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RLBMh8QOODdQJC68bvsPv0lBcMMIlbUba59PtWenDs=' 
WHERE 
  key_id = '8a432d5c8178eb22e63b8f538aa7d3672433fed48b5611780a1b4f525e055ec7' 
  AND (
    token = '1RLBMh8QOODdQJC68bvsPv0lBcMMIlbUba59PtWenDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033