UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WLv2EQc6ke82ksQJzpZKwjpfadu3QCoUroQ1C56Uihw=' 
WHERE 
  key_id = '01091b7db02d76112da777dd8e094a282ed8cb2fce02c897864d527fd63d05c8' 
  AND (
    token = 'WLv2EQc6ke82ksQJzpZKwjpfadu3QCoUroQ1C56Uihw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038