UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nyb8JwJ4PrbDk655ZX2zu7J2kVhNm1Fo5+8Li4F5HXo=' 
WHERE 
  key_id = '37ea48dd15d27889db1337d61576d67f3ec170afeaffe8fc4970602dcf22d48e' 
  AND (
    token = 'nyb8JwJ4PrbDk655ZX2zu7J2kVhNm1Fo5+8Li4F5HXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054