UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qh1stlw4d2vAb6ntRVNpBAjnhHPr9Ur7jpuMc98VjTI=' 
WHERE 
  key_id = '68331fac1915aa7e0e6c1c6ddffe95474006162bb925d82229e1776d5c5696dc' 
  AND (
    token = 'Qh1stlw4d2vAb6ntRVNpBAjnhHPr9Ur7jpuMc98VjTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034