UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l1r6YmykQFHu8ksrFbN+1/SdQ7U4r9Hgh7cIKIrXHjU=' 
WHERE 
  key_id = 'f6ecfcb616faf98b27e2bdf0f0a39ed50d667f838ab80ac69c153bdc2995a593' 
  AND (
    token = 'l1r6YmykQFHu8ksrFbN+1/SdQ7U4r9Hgh7cIKIrXHjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029