UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EycxkzqZ11ZFzZ0mjTLl9RNJcjEynwAQtQgAd8Tb1tg=' 
WHERE 
  key_id = 'ab7691275390750c91c91003e45e1351c3ce00362c5c2a4fa553a1477439ea91' 
  AND (
    token = 'EycxkzqZ11ZFzZ0mjTLl9RNJcjEynwAQtQgAd8Tb1tg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031