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

Query time 0.00055